<?php

namespace mbilling\BillingBundle\Services;

class Jabber
{
    protected $jabber;
    
    public function __construct($jabber)
    {
        $this->jabber = $jabber; 
    }

    public function check()
    {
        if ($this->jabber instanceof JabberInterface)
        {
            //echo 'Yes, this is a jabber!';
            return true;
        }
        else
        {
            //echo 'No, this is not a jabber!';
            return false;
        }
    }

    public function waitMessage($message_id = 0)
    {
        return $this->jabber->waitMessage($message_id);
    }

    public function sendMessage($action, $params = array())
    {
        return $this->jabber->sendMessage($action, $params);
    }
    
    public function checkMessage($message_id)
    {
        return $this->jabber->checkMessage($message_id);
    }
}